package com.atguigu.system.controller;

import com.atguigu.common.result.Result;
import com.atguigu.model.dto.SysDeptDTO;
import com.atguigu.system.service.SysDeptService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author quzengpeng
 * @descpription:
 * @date 2023/3/26
 */
@Api(tags = "机构管理")
@RestController
@RequestMapping("/admin/system/sysDept")
public class SysDeptController {

    @Resource
    private SysDeptService sysDeptService;

    @ApiOperation("机构列表(树形)")
    @GetMapping("findNodes")
    public Result findNodes() {
        List<SysDeptDTO> list = sysDeptService.findNodes();
        return Result.ok(list);
    }
}
